home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 1995 June / MacFormat 25.iso / Shareware City / Developers / OutOfPhase1.1 Source / OutOfPhase Folder / InstrList.h < prev    next >
Text File  |  1994-07-22  |  5KB  |  140 lines

  1. /* InstrList.h */
  2.  
  3. #ifndef Included_InstrList_h
  4. #define Included_InstrList_h
  5.  
  6. /* InstrList module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Screen */
  12. /* EventLoop */
  13. /* StringList */
  14. /* Array */
  15. /* Memory */
  16. /* Alert */
  17. /* DataMunging */
  18. /* InstrObject */
  19. /* MainWindowStuff */
  20. /* BufferedFileInput */
  21. /* BufferedFileOutput */
  22. /* Files */
  23. /* Scrap */
  24.  
  25. #include "Screen.h"
  26. #include "EventLoop.h"
  27. #include "MainWindowStuff.h"
  28.  
  29. struct InstrListRec;
  30. typedef struct InstrListRec InstrListRec;
  31.  
  32. /* forward declarations */
  33. struct MainWindowRec;
  34. struct CodeCenterRec;
  35. struct InstrObjectRec;
  36. struct BufferedInputRec;
  37. struct BufferedOutputRec;
  38. struct FileType;
  39.  
  40. /* create a new instrument list */
  41. InstrListRec*                NewInstrList(struct MainWindowRec* MainWindow,
  42.                                             struct CodeCenterRec* CodeCenter, WinType* ScreenID,
  43.                                             OrdType XLoc, OrdType YLoc, OrdType Width, OrdType Height);
  44.  
  45. /* delete the instrument list and all of the instruments it contains */
  46. void                                DisposeInstrList(InstrListRec* InstrList);
  47.  
  48. /* change the location of the instrument list in the window */
  49. void                                SetInstrListLocation(InstrListRec* InstrList,
  50.                                             OrdType XLoc, OrdType YLoc, OrdType Width, OrdType Height);
  51.  
  52. /* redraw the list */
  53. void                                InstrListRedraw(InstrListRec* InstrList);
  54.  
  55. /* see if the specified coordinates falls inside the instrument list rectangle */
  56. MyBoolean                        InstrListHitTest(InstrListRec* InstrList,
  57.                                             OrdType XLoc, OrdType YLoc);
  58.  
  59. /* handle a mouse down event for the instrument list */
  60. void                                InstrListDoMouseDown(InstrListRec* InstrList,
  61.                                             OrdType XLoc, OrdType YLoc, ModifierFlags Modifiers);
  62.  
  63. /* called when the window becomes active */
  64. void                                InstrListBecomeActive(InstrListRec* InstrList);
  65.  
  66. /* called when the window becomes inactive */
  67. void                                InstrListBecomeInactive(InstrListRec* InstrList);
  68.  
  69. /* called when a selection is made in another list, so that this list */
  70. /* is deselected */
  71. void                                InstrListDeselect(InstrListRec* InstrList);
  72.  
  73. /* check to see if there is a selection in this list */
  74. MyBoolean                        InstrListIsThereSelection(InstrListRec* InstrList);
  75.  
  76. /* check to see if any of the instruments contained in this list need to be saved */
  77. MyBoolean                        DoesInstrListNeedToBeSaved(InstrListRec* InstrList);
  78.  
  79. /* open an edit window for the selected instrument */
  80. void                                InstrListOpenSelection(InstrListRec* InstrList);
  81.  
  82. /* create a new instrument and open a window for it */
  83. void                                InstrListNewInstr(InstrListRec* InstrList);
  84.  
  85. /* delete the selected instrument */
  86. void                                InstrListDeleteSelection(InstrListRec* InstrList);
  87.  
  88. /* delete the explicitly specified instrument */
  89. void                                InstrListDeleteInstr(InstrListRec* InstrList,
  90.                                             struct InstrObjectRec* TheInstr);
  91.  
  92. /* the name of an instrument has changed, so the name in the scrolling */
  93. /* list must also be changed */
  94. void                                InstrListInstrNameChanged(InstrListRec* InstrList,
  95.                                             struct InstrObjectRec* TheInstr);
  96.  
  97. /* look for a specified instrument.  returns NIL if not found.  the name is */
  98. /* NOT null terminated */
  99. struct InstrObjectRec*    InstrListLookupNamedInstr(InstrListRec* InstrList, char* Name);
  100.  
  101. /* document's name has changed, so we need to update the windows */
  102. void                                InstrListGlobalNameChange(InstrListRec* InstrList,
  103.                                             char* NewFilename);
  104.  
  105. /* compile all of the instruments definitions */
  106. MyBoolean                        InstrListMakeUpToDate(InstrListRec* InstrList);
  107.  
  108. /* dispose of all of the objects from the instrument definitions */
  109. void                                InstrListUnbuildAll(InstrListRec* InstrList);
  110.  
  111. /* read instrument definitions from a file.  returns True if completely successful. */
  112. FileLoadingErrors        InstrListReadData(InstrListRec* InstrList,
  113.                                             struct BufferedInputRec* Input);
  114.  
  115. /* write instrument definitions to a file.  returns True if completely successful. */
  116. FileLoadingErrors        InstrListWriteData(InstrListRec* InstrList,
  117.                                             struct BufferedOutputRec* Output);
  118.  
  119. /* after a file has been saved, this is called to mark all objects as not modified. */
  120. void                                InstrListMarkAllObjectsSaved(InstrListRec* InstrList);
  121.  
  122. /* copy the selected object in the list to the clipboard.  return False if failed. */
  123. MyBoolean                        InstrListCopyObject(InstrListRec* InstrList);
  124.  
  125. /* try to paste the clipboard in as an instrument.  returns False if it failed or the */
  126. /* clipboard did not contain an instrument. */
  127. MyBoolean                        InstrListPasteObject(InstrListRec* InstrList);
  128.  
  129. /* try to paste the instrument object in from the file */
  130. MyBoolean                        InstrListPasteFromFile(InstrListRec* InstrList,
  131.                                             struct FileType* File);
  132.  
  133. /* find out how many instruments there are in this list */
  134. long                                InstrListHowMany(InstrListRec* InstrList);
  135.  
  136. /* get an indexed instruments from the list */
  137. struct InstrObjectRec*    InstrListGetIndexedInstr(InstrListRec* InstrList, long Index);
  138.  
  139. #endif
  140.